﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.IO;

namespace The_LarX
{
    public class LarContentManager : ContentManager
    {
        public LarContentManager(ServiceContainer Provider)
            : base(Provider)
        {
        }
        
        public object LoadLar(string fileName)
        {
            string path = Path.Combine(this.RootDirectory, fileName);
            if (fileName.Contains(".larimg"))
            {
                LarImage image = LarImage.Load(path, LarImageLoadOptions.None);
                return image;
            }
            if (fileName.Contains(".larscene"))
            {
                Serializer.Load(path);
                return Engine.GameScreens[0];
            }
            return null;
        }
    }
}
